/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// ptoolbar.hpp - Definition of PegToolBar and PegToolBarPanel classes
//
// Author: Jim DeLisle
//
// Copyright (c) 1997-2000 Swell Software 
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
//
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef _PEGTOOLBAR_
#define _PEGTOOLBAR_

#ifndef PEG_TOOLBAR_PAD_HEIGHT
#define PEG_TOOLBAR_PAD_HEIGHT       2
#endif

/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
class PegToolBarPanel : public PegThing
{
    public:
        PegToolBarPanel(PEGUSHORT ID = 0);
        PegToolBarPanel(const PegRect &Size, PEGUSHORT Id =0);

        virtual ~PegToolBarPanel();

        virtual void Add(PegThing *Who, PEGBOOL Showed = TRUE);
        virtual void AddToEnd(PegThing *Who, PEGBOOL Showed = TRUE);
        virtual void Draw(const PegRect &Invalid);
        virtual PegThing *Remove(PegThing *Who);

    protected:
        virtual void PositionChildren();
};

/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
class PegToolBar : public PegThing
{
    public:
        PegToolBar(PEGUSHORT ID = 0);
        virtual ~PegToolBar();

        virtual void AddPanel(PegToolBarPanel* pPanel);
        virtual void Draw(const PegRect &Invalid);
        virtual PEGINT Message(const PegMessage& Mesg);

        virtual void PositionPanels();
        virtual PegThing* RemovePanel(PegThing *Who);

    protected:
        virtual void SizeToParent();
        virtual void SizeToTallestPanel();
        
        PEGINT  mPanelHeight;
};

#endif // _PEGTOOLBAR_

